#!/bin/sh

#this script compile and run the program.

compilationCommand="gcc gauss-legendre_seq.c -lgmp"
executionCommand="./a.out"

x=a

echo "q: quit"
echo "anything else: compile and run again"
echo

while expr ${x}q != qq >/dev/null
do
	if ( $compilationCommand && echo "compilation ok" )
	then
		echo "running program"
		$executionCommand
		echo "program finish"
	fi
	read x
done
